G_OBJECT_CLASS (st_texture_cache_parent_class)->finalize (object);
}
-static gboolean
+static void
compute_pixbuf_scale (gint width,
gint height,
gint available_width,
int scaled_width, scaled_height;
if (width == 0 || height == 0)
- return FALSE;
+ {
+ *new_width = *new_height = 0;
+ return;
+ }
if (available_width >= 0 && available_height >= 0)
{
{
*new_width = scaled_width;
*new_height = scaled_height;
- return TRUE;
}
- return FALSE;
+ else
+ {
+ *new_width = width;
+ *new_height = height;
+ }
}
static void
int scaled_width;
int scaled_height;
- if (compute_pixbuf_scale (width, height, available_width, available_height,
- &scaled_width, &scaled_height))
- gdk_pixbuf_loader_set_size (pixbuf_loader, scaled_width, scaled_height);
+ compute_pixbuf_scale (width, height, available_width, available_height,
+ &scaled_width, &scaled_height);
+
+ gdk_pixbuf_loader_set_size (pixbuf_loader,
+ scaled_width,
+ scaled_height);
}
static GdkPixbuf *